home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Periodicals / develop / develop 3 code / ISO 9660 & High Sierra / iso9660 ƒ / HighSierra.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-22  |  8.7 KB  |  293 lines  |  [TEXT/KAHL]

  1. /****************************************************************************/
  2. /*                                                                            */
  3. /*    File:         HighSierra.h                                                */
  4. /*                                                                            */
  5. /*    Prefix:        HS,CD                                                        */
  6. /*                                                                            */
  7. /*    Purpose:    Provide type and constant definitions relating to High        */
  8. /*                Sierra format CDs.                                            */
  9. /*                                                                             */
  10. /*    Revision History:                                                        */
  11. /*                                                                             */
  12. /****************************************************************************/
  13. /*    Copyright © Apple Computer, Inc. 1987, 1988, 1990                        */
  14. /****************************************************************************/
  15.  
  16.  
  17. /****************************************************************************/
  18. /*    Exported Constants                                                        */
  19. /****************************************************************************/
  20.  
  21. #define    CDBLKSIZE    2048
  22. #define    HSVOLSTART    16        /* where we expect a Primary Volume Descriptor */
  23. #define HSTERMSTART    17        /* where we expect the Volume Descriptor Terminator */
  24.  
  25. #define StdVolType    1        /* Primary Volume Descriptor type */
  26. #define    VolEndType    255        /* Volume Descriptor Set Terminator type */ 
  27.  
  28. /*
  29.  * File Flags for Directory Records
  30.  */
  31. #define existenceBit    0x01
  32. #define directoryBit    0x02
  33. #define associatedBit    0x04
  34. #define recordBit        0x08
  35. #define protectionBit    0x10
  36. #define multiextentBit    0x80
  37.  
  38. /****************************************************************************/
  39. /*    Exported Types                                                            */
  40. /****************************************************************************/
  41.  
  42. typedef unsigned char byte;
  43.  
  44. #ifdef HIGHSIERRA
  45.  
  46. /****************************************************************************/
  47. /*    High Sierra (May 26, 1986) Standard                                        */
  48. /****************************************************************************/
  49. /* 
  50.  * Primary Volume Descriptor (PVD)
  51.  */
  52. typedef struct
  53. {
  54.     long    lsbLogicalBlockNumber;
  55.     long    msbLogicalBlockNumber;
  56.     byte    VDType;                    /* Must be 1 for PVD */
  57.     char    VSStdId[5];                /* Must be "CDROM" */
  58.     byte    VSStdVersion;            /* Must be 1 */
  59.     byte    Reserved1;                /* Must be 0's */
  60.     char    systemIdentifier[32];
  61.     char    volumeIdentifier[32];
  62.     char    Reserved2[8];            /* Must be 0's */
  63.     long    lsbVolumeSpaceSize;
  64.     long    msbVolumeSpaceSize;
  65.     char    Reserved3[32];            /* Must be 0's */
  66.     short    lsbVolumeSetSize;
  67.     short    msbVolumeSetSize;
  68.     short    lsbVolumeSetSequenceNumber;
  69.     short    msbVolumeSetSequenceNumber;
  70.     short    lsbLogicalBlockSize;
  71.     short    msbLogicalBlockSize;
  72.     long    lsbPathTableSize;
  73.     long    pathTableSize;
  74.     long    lsbPathTable1;            /* mandatory occurrence */
  75.     long    lsbPathTable2;            /* optional occurrence */
  76.     long    lsbPathTable3;            /* optional occurrence */
  77.     long    lsbPathTable4;            /* optional occurrence */
  78.     long    msbPathTable1;            /* mandatory occurrence */
  79.     long    msbPathTable2;            /* optional occurrence */
  80.     long    msbPathTable3;            /* optional occurrence */
  81.     long    msbPathTable4;            /* optional occurrence */
  82.     char    rootDirectoryRecord[34];
  83.     char    volumeSetIdentifier[128];
  84.     char    publisherIdentifier[128];
  85.     char    dataPreparerIdentifier[128];
  86.     char    applicationIdentifier[128];
  87.     char    copyrightFileIdentifier[32];
  88.     char    abstractFileIdentifier[32];
  89.     char    volumeCreation[16];
  90.     char    volumeModification[16];
  91.     char    volumeExpiration[16];
  92.     char    volumeEffective[16];
  93.     char    FileStructureStandardVersion;
  94.     char    Reserved4;                /* Must be 0's */
  95.     char    ApplicationUse[512];
  96.     char    FutureStandardization[680];
  97. } PVD, *PVDPtr;
  98.  
  99. /*
  100.  * Path Table
  101.  */
  102.  
  103. typedef char    dirIDArray[8];
  104.  
  105. typedef struct
  106. {
  107.     long    dirLocation;    /* 1st logical block where directory is stored */
  108.     byte    XARlength;    /* Extended Attribute Record Length */
  109.     byte    len_di;            /* length of directory identifier */
  110.     short    parentDN;        /* parent directory number */
  111.     dirIDArray    dirID;        /* directory identifier: actual length is
  112.                              *    9 - [8+Len_di]; there is an extra blank
  113.                              *    byte if Len_di is odd.
  114.                              */
  115. } PathTableRecord, *PathTableRecordPtr;
  116.  
  117. /*
  118.  * Directory Record
  119.  *    There exists one of these for each file in the directory.
  120.  *    
  121.  */
  122. typedef struct
  123. {
  124.     char    macFlag[2];        /* $42 $41 - 'BA' famous value */
  125.     byte    systemUseID;    /* 06 = HFS */
  126.     byte    fileType[4];    /* such as 'TEXT' or 'STAK' */
  127.     byte    fileCreator[4];    /* such as 'hscd' or 'WILD' */
  128.     byte    finderFlags[2];
  129. } OldAppleExtension;
  130.  
  131. typedef struct
  132. {
  133.     char    signature[2];        /* $41 $41 - 'AA' famous value */
  134.     byte    extensionLength;    /* $0E for this ID */
  135.     byte    systemUseID;    /* 02 = HFS */
  136.     byte    fileType[4];    /* such as 'TEXT' or 'STAK' */
  137.     byte    fileCreator[4];    /* such as 'hscd' or 'WILD' */
  138.     byte    finderFlags[2];
  139. } AppleExtension;
  140.  
  141.  
  142. typedef struct
  143. {
  144.     byte    len_dr;            /* directory record length */
  145.     byte    XARlength;    /* Extended Attribute Record Length */
  146.     long    lsbStart;
  147.     long    msbStart;            /* 1st logical block where file starts */
  148.     long    lsbDataLength;
  149.     long    msbDataLength;
  150.     byte    year;            /* since 1900 */
  151.     byte    month;
  152.     byte    day;
  153.     byte    hour;
  154.     byte    minute;
  155.     byte    second;
  156.     byte    fileFlags;
  157.     byte    reserved;        /* must be 0 */
  158.     byte    interleaveSize;
  159.     byte    interleaveSkip;
  160.     short    lsbVolSetSeqNum;
  161.     short    msbVolSetSeqNum;    /* which volume in volume set contains this file. */
  162.     byte    len_fi;                /* length of file identifier which follows */
  163.     char    fi[34];                /* file identifier: actual is 34-[33+Len_fi].
  164.                                     contains extra blank byte if Len_fi odd */
  165.     AppleExtension    apple;        /* this actually fits immediately after the fi[] */
  166.                                 /* field, or after its padding byte. */
  167. } DirRcd, *DirRcdPtr;
  168.     
  169. #endif
  170.  
  171.  
  172. /****************************************************************************/
  173. /*    ISO 9660 (pANS Z39.86 198x) standard format                                */
  174. /****************************************************************************/
  175.  
  176. /* 
  177.  * Primary Volume Descriptor (PVD)
  178.  */
  179. typedef struct
  180. {
  181.     byte    VDType;                    /* Must be 1 for PVD */
  182.     char    VSStdId[5];                /* Must be "CD001" */
  183.     byte    VSStdVersion;            /* Must be 1 */
  184.     byte    Reserved1;                /* Must be 0's */
  185.     char    systemIdentifier[32];
  186.     char    volumeIdentifier[32];
  187.     char    Reserved2[8];            /* Must be 0's */
  188.     long    lsbVolumeSpaceSize;
  189.     long    msbVolumeSpaceSize;
  190.     char    Reserved3[32];            /* Must be 0's */
  191.     short    lsbVolumeSetSize;
  192.     short    msbVolumeSetSize;
  193.     short    lsbVolumeSetSequenceNumber;
  194.     short    msbVolumeSetSequenceNumber;
  195.     short    lsbLogicalBlockSize;
  196.     short    msbLogicalBlockSize;
  197.     long    lsbPathTableSize;
  198.     long    msbPathTableSize;
  199.     long    lsbPathTable1;            /* mandatory occurrence */
  200.     long    lsbPathTable2;            /* optional occurrence */
  201.     long    msbPathTable1;            /* mandatory occurrence */
  202.     long    msbPathTable2;            /* optional occurrence */
  203.     char    rootDirectoryRecord[34];
  204.     char    volumeSetIdentifier[128];
  205.     char    publisherIdentifier[128];
  206.     char    dataPreparerIdentifier[128];
  207.     char    applicationIdentifier[128];
  208.     char    copyrightFileIdentifier[37];
  209.     char    abstractFileIdentifier[37];
  210.     char    bibliographicFileIdentifier[37];
  211.     char    volumeCreation[17];
  212.     char    volumeModification[17];
  213.     char    volumeExpiration[17];
  214.     char    volumeEffective[17];
  215.     char    FileStructureStandardVersion;
  216.     char    Reserved4;                /* Must be 0's */
  217.     char    ApplicationUse[512];
  218.     char    FutureStandardization[653];
  219. } PVD, *PVDPtr;
  220.  
  221. /*
  222.  * Path Table
  223.  */
  224.  
  225. typedef char    dirIDArray[8];
  226.  
  227. typedef struct
  228. {
  229.     byte    len_di;            /* length of directory identifier */
  230.     byte    XARlength;    /* Extended Attribute Record Length */
  231.     long    dirLocation;    /* 1st logical block where directory is stored */
  232.     short    parentDN;        /* parent directory number */
  233.     dirIDArray    dirID;        /* directory identifier: actual length is
  234.                              *    9 - [8+Len_di]; there is an extra blank
  235.                              *    byte if Len_di is odd.
  236.                              */
  237. } PathTableRecord, *PathTableRecordPtr;
  238.  
  239. /*
  240.  * Directory Record
  241.  *    There exists one of these for each file in the directory.
  242.  *    
  243.  */
  244. typedef struct
  245. {
  246.     char    macFlag[2];        /* $42 $41 - 'BA' famous value */
  247.     byte    systemUseID;    /* 06 = HFS */
  248.     byte    fileType[4];    /* such as 'TEXT' or 'STAK' */
  249.     byte    fileCreator[4];    /* such as 'hscd' or 'WILD' */
  250.     byte    finderFlags[2];
  251. } OldAppleExtension;
  252.  
  253.  
  254. typedef struct
  255. {
  256.     char    signature[2];        /* $41 $41 - 'AA' famous value */
  257.     byte    extensionLength;    /* $0E for this ID */
  258.     byte    systemUseID;    /* 02 = HFS */
  259.     byte    fileType[4];    /* such as 'TEXT' or 'STAK' */
  260.     byte    fileCreator[4];    /* such as 'hscd' or 'WILD' */
  261.     byte    finderFlags[2];
  262. } AppleExtension;
  263.  
  264.  
  265. typedef struct
  266. {
  267.     byte    len_dr;                /* directory record length */
  268.     byte    XARlength;            /* Extended Attribute Record Length */
  269.     long    lsbStart;
  270.     long    msbStart;            /* 1st logical block where file starts */
  271.     long    lsbDataLength;
  272.     long    msbDataLength;
  273.     byte    year;                /* since 1900 */
  274.     byte    month;
  275.     byte    day;
  276.     byte    hour;
  277.     byte    minute;
  278.     byte    second;
  279.     byte    gmtOffset;
  280.     byte    fileFlags;
  281.     byte    interleaveSize;
  282.     byte    interleaveSkip;
  283.     short    lsbVolSetSeqNum;
  284.     short    msbVolSetSeqNum;    /* which volume in volume set contains this file. */
  285.     byte    len_fi;                /* length of file identifier which follows */
  286.     char    fi[37];                /* file identifier: actual is 37-[36+Len_fi].
  287.                                     contains extra blank byte if Len_fi odd */
  288.     AppleExtension    apple;        /* this actually fits immediately after the fi[] */
  289.                                 /* field, or after its padding byte. */
  290. } DirRcd, *DirRcdPtr;
  291.     
  292.  
  293.